#pragma once

#include "CarSimDefs.h"

class Obstacle
{
	
	Pos2d * m_arrP2ObstaclePoly;
	int m_nNumPts;

	bool m_bPositionsValid;

	double m_arrLfBbox[4]; // 0 and 1 are min in x and y, 2 and 3 are max

	void CalcBbox();
public:
	Obstacle(void);
	~Obstacle(void);

	void SetPolySize(int nPoints);

	void SetPolyPositionsRandom(const Pos2d p2CenterMin, const Pos2d p2CenterMax, double lfExpectedRadius, const double * arrLfBboxExclude1, const double * arrLfBboxExclude2);

	inline const Pos2d * GetPolyPts() const
	{
		if(m_bPositionsValid)
		{
			return m_arrP2ObstaclePoly;
		}
		return NULL;
	}

	inline int GetNumPts() const { return m_nNumPts; }

	inline const double * GetBbox() const { return m_arrLfBbox; }
};
